home *** CD-ROM | disk | FTP | other *** search
- /*
- Screen
- 2.50
- 19-Jun-1990
- ANSI C for MS-DOS w/monochrome or color text display
-
- Provides a set of functions for manipulating a text display.
- To drastically improve the speed of this module, NO RANGE
- CHECKING is done! Invalid line/column values may cause
- portions of non-video memory to be corrupted!
-
- Written by Scott Robert Ladd. Released into the public domain.
- */
-
- #if !defined(__SCREEN_H)
- #define __SCREEN_H 1
-
- #include "stddef.h"
-
- typedef enum {BT_NONE, BT_SINGLE, BT_DOUBLE, BT_SOLID} BoxType;
-
- typedef enum {SM_UNKNOWN = -1, SM_25x40 = 0, SM_25x80,
- SM_30x80, SM_43x80, SM_50x80} ScrMode;
-
- typedef enum {ST_UNKNOWN = -1, ST_MDA = 0, ST_CGA, ST_HGC,
- ST_EGA, ST_MCGA, ST_VGA} ScrType;
-
- typedef enum {SA_DIRECT, SA_BIOS} ScrAccess;
-
- #define SCR_F_BLACK 0x00
- #define SCR_F_BLUE 0x01
- #define SCR_F_GREEN 0x02
- #define SCR_F_RED 0x04
- #define SCR_F_CYAN (SCR_F_BLUE | SCR_F_GREEN)
- #define SCR_F_VIOLET (SCR_F_RED | SCR_F_BLUE)
- #define SCR_F_YELLOW (SCR_F_RED | SCR_F_GREEN)
- #define SCR_F_BROWN (SCR_F_YELLOW)
- #define SCR_F_WHITE (SCR_F_BLUE | SCR_F_GREEN | SCR_F_RED)
- #define SCR_F_BRIGHT 0x08
-
- #define SCR_B_BLACK 0x00
- #define SCR_B_BLUE 0x10
- #define SCR_B_GREEN 0x20
- #define SCR_B_RED 0x40
- #define SCR_B_CYAN (SCR_B_BLUE | SCR_B_GREEN)
- #define SCR_B_VIOLET (SCR_B_RED | SCR_B_BLUE)
- #define SCR_B_YELLOW (SCR_B_RED | SCR_B_GREEN)
- #define SCR_B_BROWN (SCR_B_YELLOW)
- #define SCR_B_WHITE (SCR_B_BLUE | SCR_B_GREEN | SCR_B_RED)
- #define SCR_B_BRIGHT 0x80
-
- #define SCR_BLINK 0x80
- #define SCR_UNDER 0x08
-
- ScrType ScrOpen(void);
-
- void ScrClose(void);
-
- int ScrSetMode(ScrMode mode);
-
- ScrMode ScrGetMode(void);
-
- void ScrSetAccess(ScrAccess access);
-
- ScrAccess ScrGetAccess(void);
-
- void ScrDimensions(unsigned int * wid, unsigned int * len);
-
- void ScrCursorHide(void);
- void ScrCursorUnhide(void);
-
- void ScrCursorSetPos(unsigned int line, unsigned int col);
- void ScrCursorGetPos(unsigned int * line, unsigned int * col);
-
- void ScrPutChar(unsigned int line, unsigned int col,
- unsigned char attr, char ch);
-
- void ScrGetChar(unsigned int line, unsigned int col,
- unsigned char * attr, char * ch);
-
- void ScrPutStr(unsigned int line, unsigned int col,
- unsigned char attr, char * str);
-
- void ScrPrintf(unsigned int line, unsigned int col,
- unsigned char attr, char * format, ...);
-
- void ScrDrawBox(unsigned int topLine, unsigned int leftCol,
- unsigned int btmLine, unsigned int rightCol,
- unsigned char attr, BoxType typeBox);
-
- void ScrScrollUp(unsigned int topLine, unsigned int leftCol,
- unsigned int btmLine, unsigned int rightCol,
- unsigned char attr, unsigned int noOfLines);
-
- void ScrScrollDown(unsigned int topLine, unsigned int leftCol,
- unsigned int btmLine, unsigned int rightCol,
- unsigned char attr, unsigned int noOfLines);
-
- void ScrClear(void);
- void ScrClearLine(unsigned int line, unsigned int col);
-
- #endif
-